import Vue from 'vue'
import VueRouter from 'vue-router'
// import VueRouter from './myrouter'
import Home from '../home.vue'
import List from '../list.vue'
Vue.use(VueRouter)
let ary = [
  // 路由映射表
  {
    path:'/',
    redirect:'/home'
  },
  {
    path:'/home',
    component:Home,
    meta:{
      // 路由元信息 
      a:123,
      title:'home',
      age:999,
      flag:true,
      name:'home',
      level:3
    },
    children:[
      {
        path:'/home/a',
        component:()=>import('../a.vue'),
        meta:{
          level:6,
          title:'a'
        }
      },
      {
        path:'/home/b',
        component:()=>import('../b.vue'),
        meta:{
          level:6,
          title:'b'
        }
      }
    ]
  },
  {
    path:'/list/:qqq',
    meta:{
      name:'list',
      level:2,
      title:'list'
    },
    name:'mylist',
    component:List
  },
  {
    path:'/404',
    component:()=>import(/*webpackChunkName:'404' */ '../404.vue')
  },
  {
    path:'/*',
    redirect:'/404'
  }

];
export default new VueRouter({
  mode:'hash',// 默认就是 hash  history 是需要后台配合使用的
  routes:ary,
  linkActiveClass:'current',// 默认是router-link-active
  linkExactActiveClass:'active',// 默认就是 router-link-exact-active
})